# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=itinerary
pkgver=23.08.4
pkgrel=0
# armhf blocked by qt5-qtdeclarative
# ppc64le blocked by kitinerary
# s390x blocked by qt5-qtdeclarative
arch="aarch64 armv7 x86_64 x86"
url="https://invent.kde.org/pim/itinerary"
pkgdesc="Itinerary and boarding pass management application"
license="BSD-3-Clause AND LGPL-2.0-or-later"
depends="
	kirigami-addons
	kirigami2
	kitemmodels5
	kopeninghours
	prison5
	qt5-qtlocation
	tzdata
	"
makedepends="
	extra-cmake-modules
	kcontacts5-dev
	kcoreaddons5-dev
	kdbusaddons5-dev
	kholidays5-dev
	ki18n5-dev
	kirigami-addons-dev
	kitinerary-dev
	knotifications5-dev
	kosmindoormap-dev
	kpkpass-dev
	kpublictransport-dev
	networkmanager-qt5-dev
	qqc2-desktop-style5-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtlocation-dev
	qt5-qtquickcontrols2-dev
	samurai
	shared-mime-info
	solid5-dev
	zlib-dev
	"
checkdepends="
	dbus
	xvfb-run
	"
_repo_url="https://invent.kde.org/pim/itinerary.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/itinerary-$pkgver.tar.xz"
subpackages="$pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# tripgrouptest and timelinemodel test are broken
	dbus-run-session xvfb-run ctest --test-dir build --output-on-failure -E "(tripgroup|timelinemodel)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ed7c6bb43696f36b470926ef1c56d00975833517dee697260551167f784b16d5defb48be64b57fa68335858b222ba6888bcae29b98f6da5848d125844e4d5347  itinerary-23.08.4.tar.xz
"
